/* Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _H_LIBZLANG_GTK_
#define _H_LIBZLANG_GTK_

#include "zlang.h"

#include "list.h"

#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkevents.h>
#include <gst/gst.h>
#include <gst/video/video-info.h>

#include "gtksourceview/gtksource.h"
#include "gtksourceview/gtksourcebuffer.h"
#include "gtksourceview/gtksourceview.h"
#include "gtksourceview/gtksourcecompletionprovider.h"

/*
 * VS2019 DEBUG PARAMETERS BACKUP :
 *     test_window_scrollwindowlayout_sourceeditarea_1.z
 *     $(ProjectDir)..\..\test
 * 
 *     ZEUX.z
 *     D:\Work\Zlang Projects\ZEUX\src
 */

#if ( defined _WIN32 )
#pragma warning(disable: 4996) 
#endif

#if ( defined __linux ) || ( defined __unix )
#define STRTOK_R	strtok_r
#elif ( defined _WIN32 )
#define STRTOK_R	strtok_s
#else
#define STRTOK_R	strtok_r
#endif

#define ZLANG_OBJECT_guiwindow			"guiwindow"

#define ZLANG_OBJECT_guifixedlayout		"guifixedlayout"
#define ZLANG_OBJECT_guiboxlayout		"guiboxlayout"
#define ZLANG_OBJECT_guicenterboxlayout		"guicenterboxlayout"
#define ZLANG_OBJECT_guiflowboxlayout		"guiflowboxlayout"
#define ZLANG_OBJECT_guigridlayout		"guigridlayout"
#define ZLANG_OBJECT_guiscrollwindowlayout	"guiscrollwindowlayout"
#define ZLANG_OBJECT_guiframelayout		"guiframelayout"
#define ZLANG_OBJECT_guipanedlayout		"guipanedlayout"
#define ZLANG_OBJECT_guinotebooklayout		"guinotebooklayout"
#define ZLANG_OBJECT_guipopoverlayout		"guipopoverlayout"

#define ZLANG_OBJECT_guimenubar			"guimenubar"
#define ZLANG_OBJECT_guimenu			"guimenu"
#define ZLANG_OBJECT_guimenuitem		"guimenuitem"
#if 0
#define ZLANG_OBJECT_guicheckmenuitem		"guicheckmenuitem"
#define ZLANG_OBJECT_guimenuseparatoritem	"guimenuseparatoritem"
#endif

#define ZLANG_OBJECT_guitoolbar			"guitoolbar"
#define ZLANG_OBJECT_guitoolseparatoritem	"guitoolseparatoritem"

#define ZLANG_OBJECT_guilabel			"guilabel"
#define ZLANG_OBJECT_guiedit			"guiedit"
#define ZLANG_OBJECT_guieditarea		"guieditarea"
#define ZLANG_OBJECT_guisourceeditarea		"guisourceeditarea"
#define ZLANG_OBJECT_guibutton			"guibutton"
#define ZLANG_OBJECT_guilistbox			"guilistbox"
#define ZLANG_OBJECT_guicombobox		"guicombobox"
#define ZLANG_OBJECT_guitable			"guitable"
#define ZLANG_OBJECT_guitablecolumn_int_text	"guitablecolumn_int_text"
#define ZLANG_OBJECT_guitablecolumn_double_text	"guitablecolumn_double_text"
#define ZLANG_OBJECT_guitablecolumn_string_text	"guitablecolumn_string_text"
#define ZLANG_OBJECT_guitablecolumn_icon	"guitablecolumn_icon"
#define ZLANG_OBJECT_guitreetable		"guitreetable"
#define ZLANG_OBJECT_guitreenode		"guitreenode"
#define ZLANG_OBJECT_guitreecolumn_toggle	"guitreecolumn_toggle"
#define ZLANG_OBJECT_guitreecolumn_progress	"guitreecolumn_progress"
#define ZLANG_OBJECT_guitreecolumn_int_text	"guitreecolumn_int_text"
#define ZLANG_OBJECT_guitreecolumn_double_text	"guitreecolumn_double_text"
#define ZLANG_OBJECT_guitreecolumn_string_text	"guitreecolumn_string_text"
#define ZLANG_OBJECT_guispinbutton		"guispinbutton"
#define ZLANG_OBJECT_guicheckbutton		"guicheckbutton"
#define ZLANG_OBJECT_guiradiobutton		"guiradiobutton"
#define ZLANG_OBJECT_guitogglebutton		"guitogglebutton"
#define ZLANG_OBJECT_guilinkbutton		"guilinkbutton"
#define ZLANG_OBJECT_guilevelbar		"guilevelbar"
#define ZLANG_OBJECT_guiprogressbar		"guiprogressbar"
#define ZLANG_OBJECT_guicalendar		"guicalendar"
#define ZLANG_OBJECT_guiimage			"guiimage"
#define ZLANG_OBJECT_guiswitch			"guiswitch"
#define ZLANG_OBJECT_guivideo			"guivideo"
#define ZLANG_OBJECT_guiseparator		"guiseparator"
#define ZLANG_OBJECT_guictl			"guictl"

#define ZLANG_OBJECT_guimessagedialog		"guimessagedialog"
#define ZLANG_OBJECT_guiaboutdialog		"guiaboutdialog"
#define ZLANG_OBJECT_guicolorchooserdialog	"guicolorchooserdialog"
#define ZLANG_OBJECT_guifilechooserdialog	"guifilechooserdialog"
#define ZLANG_OBJECT_guifontchooserdialog	"guifontchooserdialog"

#define ZLANG_OBJECT_guiorientation		"guiorientation"
#define ZLANG_OBJECT_guialign			"guialign"
#define ZLANG_OBJECT_guijustify			"guijustify"
#define ZLANG_OBJECT_guimouse			"guimouse"
#define ZLANG_OBJECT_guikey			"guikey"
#define ZLANG_OBJECT_guilicense			"guilicense"

#define ZLANG_OBJECT_guimonitor			"guimonitor"
#define ZLANG_OBJECT_guiclipboard		"guiclipboard"

#define WIDGET_ZOBJECT_NAME			"widget_zobject_name"

#define GTK_EVENT_DELETE			"delete-event"
#define GTK_EVENT_DESTROY			"destroy"
#define GTK_EVENT_CLICKED			"clicked"
#define GTK_EVENT_SELECTED_ROWS_CHANGED		"selected-rows-changed"
#define GTK_EVENT_CHANGED			"changed"
#define GTK_EVENT_VALUE_CHANGED			"value-changed"
#define GTK_EVENT_TOGGLED			"toggled"
#define GTK_EVENT_ACTIVATE			"activate"
#define GTK_EVENT_CHANGE_STATE			"change-state"
#define GTK_EVENT_FOCUS_IN			"focus-in-event"
#define GTK_EVENT_FOCUS_OUT			"focus-out-event"
#define GTK_EVENT_BUTTON_PRESSED		"button-pressed-event"
#define GTK_EVENT_BUTTON_RELEASED		"button-released-event"
#define GTK_EVENT_PRESSED			"pressed"
#define GTK_EVENT_RELEASED			"released"
#define GTK_EVENT_BUTTON_ACTIVATE_LINK		"activate-link"
#define GTK_EVENT_RESPONSE			"response"
#define GTK_EVENT_KEY_PRESSED			"key-pressed"
#define GTK_EVENT_KEY_RELEASED			"key-released"
#define GTK_EVENT_MODIFIED_CHANGED		"modified-changed"
#define GTK_EVENT_ROW_ACTIVATED			"row-activated"
#define GTK_EVENT_ROW_SELECTED			"row-selected"
#define GTK_EVENT_CLOSE_REQUEST			"close-request"
#define GTK_EVENT_ENTER				"enter"
#define GTK_EVENT_LEAVE				"leave"
#define GTK_EVENT_NOTIFY_IS_ACTIVE		"notify::is-active"
#define GTK_EVENT_NOTIFY_MAXIMIZED		"notify::maximized"
#define GTK_EVENT_NOTIFY_MINIMIZED		"notify::minimized"
#define GTK_EVENT_NOTIFY_FULLSCREENED		"notify::fullscreened"
#define GTK_EVENT_NOTIFY_CURSOR_POSITION	"notify::cursor-position"
#define GTK_EVENT_NOTIFY_HAS_SELECTION		"notify::has-selection"
#define GTK_EVENT_DAY_SELECTED			"day-selected"
#define GTK_EVENT_CHILD_ACTIVATED		"child-activated"

#define GUIICONNAME_DOCUMENT_NEW	"document-new"
#define GUIICONNAME_DOCUMENT_OPEN	"document-open"
#define GUIICONNAME_DOCUMENT_SAVE	"document-save"
#define GUIICONNAME_DOCUMENT_SAVE_AS	"document-save-as"
#define GUIICONNAME_APPLICATION_EXIT	"application-exit"
#define GUIICONNAME_EDIT_UNDO		"edit-undo"
#define GUIICONNAME_EDIT_REDO		"edit-redo"
#define GUIICONNAME_EDIT_CUT		"edit-cut"
#define GUIICONNAME_EDIT_COPY		"edit-copy"
#define GUIICONNAME_EDIT_PASTE		"edit-paste"
#define GUIICONNAME_EDIT_DELETE		"edit-delete"
#define GUIICONNAME_GO_BACK		"go-back"
#define GUIICONNAME_GO_FORWARD		"go-forward"
#define GUIICONNAME_GO_HOME		"go-home"
#define GUIICONNAME_LIST_ADD		"list-add"
#define GUIICONNAME_LIST_REMOVE		"list-remove"

#define GUIICONSIZE_SMALL_TOOLBAR_BUTTON	16
#define GUIICONSIZE_MIDDLE_TOOLBAR_BUTTON	32
#define GUIICONSIZE_LARGE_TOOLBAR_BUTTON	64

#define GUISHADOW_IN			GTK_SHADOW_IN
#define GUISHADOW_OUT			GTK_SHADOW_OUT
#define GUISHADOW_ETCHED_IN		GTK_SHADOW_ETCHED_IN
#define GUISHADOW_ETCHED_OUT		GTK_SHADOW_ETCHED_OUT

#define GUIMOUSE_LEFT_BUTTON		GDK_BUTTON_PRIMARY
#define GUIMOUSE_MIDDLE_BUTTON		GDK_BUTTON_MIDDLE
#define GUIMOUSE_RIGHT_BUTTON		GDK_BUTTON_SECONDARY

#define GUIMOUSE_SINGLE_PRESS		1
#define GUIMOUSE_DOUBLE_PRESS		2
#define GUIMOUSE_TRIPLE_PRESS		3

#if 0
#define GUIWINDOWPOSITION_CENTER		GTK_WIN_POS_CENTER
#define GUIWINDOWPOSITION_MOUSE			GTK_WIN_POS_MOUSE
#define GUIWINDOWPOSITION_CENTER_ALWAYS		GTK_WIN_POS_CENTER_ALWAYS
#define GUIWINDOWPOSITION_CENTER_ON_PARENT	GTK_WIN_POS_CENTER_ON_PARENT
#endif

#define G_OBJECT_SET_DATA_KEY_GUILISTBOX_XALIGN		"zobjects_gtk_guilistbox_xalign"

/*
 * util
 */

struct StringListNode
{
	struct list_head	str_list_node ;

	char			str[0] ;
} ;

int AppendStringList( struct list_head *string_list , char *str );
struct StringListNode *TravelStringList( struct list_head *string_list , struct StringListNode *string_list_node );
void UnlinkStringListNode( struct StringListNode *string_list_node );

/*
 * gtk external
 */

void FastDestroyObject( void *obj );

void SetGtkWidgetMarginWidth( GtkWidget *gtk_widget , int margin_width );
void SetGtkWidgetVerticalMarginWidth( GtkWidget *gtk_widget , int vertical_margin_width );
void SetGtkWidgetHorizontalMarginWidth( GtkWidget *gtk_widget , int horizon_margin_width );
void SetGtkWidgetMarginAllWidth( GtkWidget *gtk_widget , int top_margin_width , int bottom_margin_width , int left_margin_width , int right_margin_width );
void SetGtkGridSpaceWidth( GtkWidget *gtk_widget , int column_spacing_width , int row_spacing_width );

int TransferMasterObjectToOutputObject( struct ZlangRuntime *rt , struct ZlangObject *out_obj , struct ZlangObject *master_obj );
struct ZlangObject *TransferInputObjectToNewObject( struct ZlangRuntime *rt , struct ZlangObject *in_obj );

struct DialogResponseContext
{
	GMainLoop	*main_loop ;
	int		response_id ;
} ;

void OnGtkDialogResponseEventProc( GtkDialog *gtk_dialog , gint response_id, gpointer data );

int GtkDialogRun( struct ZlangRuntime *rt , GtkDialog *gtk_dialog );
int GtkNativeDialogRun( struct ZlangRuntime *rt , GtkNativeDialog *gtk_dialog );

/*
 * window
 */

struct ZlangDirectProperty_guiwidget_common
{
	GtkWidget			*gtk_widget ;
	GMenu				*menu ;
	GMenuItem			*menu_item ;
	GtkTreeIter			tree_iter ;
	struct ZlangObject		*guiwindow_obj ;

	GtkWidget			*gtk_event_box ;
	GtkWidget			*gtk_frame ;
	GtkWidget			*gtk_alignment ;
	void				*gtk_inner ;

	guint				timer_id ;

	GType				gtk_widget_type_id ;

	union
	{
		struct ZlangObject	*str_obj ;
	} zobjects_data ;

	struct list_head		ctl_set_enable_to_ctl_list ;
} ;

GtkWidget *GetControlParentGtkWidget( struct ZlangDirectProperty_guiwidget_common *guiwidget_common );
GtkWidget *GetControlGtkEventBoxOrInnerOrWidget( struct ZlangDirectProperty_guiwidget_common *guiwidget_common );

struct WindowControlGroup
{
	char			*group_name ;
	GSList			*current_gslist_node ;
	GtkWidget		*first_gtk_widget ;

	struct list_head	win_ctl_grp_list_node ;
} ;

struct WindowControlGroup *GetGtkControlGroup( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , char *group_name );
struct WindowControlGroup *AddGtkControlGroup( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , char *group_name );
int AddGtkWidgetToGsList( struct ZlangRuntime *rt , GSList **gtk_widget_list , GtkWidget *gtk_widget );
int GetGtkListSelectedRow( struct ZlangRuntime *rt , GSList *gtk_widget_list );
GtkWidget *GetGtkListSelectedWidget( struct ZlangRuntime *rt , GSList *gtk_widget_list );

#define ADD_GTK_WIDGET_TO_GSLIST(_gtk_ctl_grp_,_guictl_direct_prop_) \
	{ \
		int	nret = 0 ; \
		\
		nret = AddGtkWidgetToGsList( rt , & (gtk_ctl_grp->current_gslist_node) , _guictl_direct_prop_->common.gtk_widget ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			return nret; \
		} \
	} \

struct WindowCallbackControl
{
	struct ZlangObject	*guictl_obj ;

	struct list_head	win_callback_ctl_list_node ;
} ;

struct WindowCallbackContext
{
	char			*event_name ;
	struct ZlangObject	*funcp ;

	struct ZlangRuntime	*rt ;
	struct ZlangObject	*guiwindow_obj ;

	int			button_type ;
	int			n_press ;
	int			x ;
	int			y ;

	unsigned char		ret_bool ;

	int			key_state ;
	int			key_val ;

	guint			interval_milliseconds ;
	guint			timer_id ;

	struct list_head	win_callback_ctx_list_node ;
} ;

struct ControlCallbackContext
{
	char			*event_name ;
	struct ZlangObject	*funcp ;

	struct ZlangRuntime	*rt ;
	struct ZlangObject	*guiwindow_obj ;
	struct ZlangObject	*guictl_obj ;
	GSimpleAction		*action ;

	int			button_type ;
	int			n_press ;
	int			x ;
	int			y ;

	unsigned char		ret_bool ;
	GdkEvent		*gdk_event ;

	int			key_state ;
	int			key_val ;

	struct list_head	ctl_callback_ctx_list_node ;
} ;

#define GUIWINDOWTYPE_CUSTOM		0
#define GUIWINDOWTYPE_SINGLE_DOCUMENT	1
#define GUIWINDOWTYPE_MULTIPLE_DOCUMENT	2
#define GUIWINDOWTYPE_DIALOG		3

#define GUIWINDOW_DIALOG_MARGIN_DEFAULT		10

#define GUIWINDOW_GRIDLAYOUT_COLUMN_SPACING_WIDTH_DEFAULT	3
#define GUIWINDOW_GRIDLAYOUT_ROW_SPACING_WIDTH_DEFAULT		3

struct ZlangDirectProperty_guiwindow
{
	struct ZlangDirectProperty_guiwidget_common	common ;

	GMainLoop			*main_loop ;
	
	unsigned char			is_close_signal_connected ;
	GSimpleActionGroup		*action_group ;
	GActionMap			*action_map ;
	GtkEventController		*shortcut_controller ;

	int				window_type ;
	union WindowTypeData
	{
		struct SingleDocumentWindowLayout
		{
			struct ZlangDirectProperty_guiwidget_common	guiboxlayout_common ;

			struct ZlangObject	*guimenubar_obj ;
			struct ZlangObject	*guitoolbar_obj ;
			struct ZlangObject	*guicontent_obj ;
			struct ZlangObject	*guistatusbar_obj ;
		} single_doc_win_layouts ;

		struct MultupleDocumentWindowLayout
		{
			struct ZlangDirectProperty_guiwidget_common	guiboxlayout_common ;

			struct ZlangObject	*guimenubar_obj ;
			struct ZlangObject	*guitoolbar_obj ;
			struct ZlangObject	*guinotebooklayout_obj ;
			struct ZlangObject	*guistatusbar_obj ;
		} multiple_doc_win_layouts ;

		struct DialogWindowLayout
		{
			struct ZlangDirectProperty_guiwidget_common	guiboxlayout_common ;
		} dlg_win_layouts ;
	} window_type_data ;

	struct list_head		win_gene_callback_ctx_list ; /* struct WindowCallbackContext */
	struct list_head		win_focus_callback_ctx_list ; /* struct WindowCallbackContext */
	struct list_head		win_unfocus_callback_ctx_list ; /* struct WindowCallbackContext */
	struct list_head		win_key_callback_ctx_list ; /* struct WindowCallbackContext */
	struct list_head		win_mouse_button_callback_ctx_list ; /* struct WindowCallbackContext */
	struct list_head		win_state_callback_ctx_list ; /* struct WindowCallbackContext */
	struct list_head		win_timer_callback_ctx_list ; /* struct WindowCallbackContext */
	struct WindowCallbackContext	*win_close_callback_ctx ; /* struct WindowCallbackContext */
	struct list_head		ctl_gene_callback_ctx_list ; /* struct ControlCallbackContext */
	struct list_head		ctl_focus_callback_ctx_list ; /* struct ControlCallbackContext */
	struct list_head		ctl_unfocus_callback_ctx_list ; /* struct ControlCallbackContext */
	struct list_head		ctl_key_callback_ctx_list ; /* struct ControlCallbackContext */
	struct list_head		ctl_mouse_button_callback_ctx_list ; /* struct ControlCallbackContext */
	struct list_head		ctl_listbox_row_callback_ctx_list ; /* struct ControlCallbackContext */
	struct list_head		ctl_flowbox_child_activated_callback_ctx_list ; /* struct ControlCallbackContext */
	struct list_head		ctl_notify_callback_ctx_list ; /* struct ControlCallbackContext */
	struct list_head		ctl_menu_item_callback_ctx_list ; /* struct ControlCallbackContext */
	unsigned char			had_set_close_window_callback ;
	unsigned char			is_showed ;

	struct list_head		win_callback_ctl_list ; /* struct WindowCallbackControl */

	struct list_head		win_ctl_grp_list ; /* struct WindowControlGroup */

	struct GlobalStyle
	{
		int32_t			ctl_default_margin ;
		int32_t			notebook_height_size ;
	} global_style ;
} ;

void QuitGtkMainLoop( struct ZlangObject *guiwindow_obj );

int AddWindowGeneralEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkWindowGeneralEventProc( GtkWidget *widget , gpointer data );
int InvokeGtkWindowEventCallbackFunction( struct WindowCallbackContext *win_callback_ctx );

int AddWindowFocusEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkWindowFocusEventProc( GtkWidget *widget , gpointer data );
void OnGtkWindowUnfocusEventProc( GtkWidget *widget , gpointer data );

int AddWindowKeyEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , char *event_name , struct ZlangObject *funcp );
gboolean OnGtkWindowKeyEventProc( GtkWidget *widget , guint keyval , guint keycode , GdkModifierType state , gpointer data );
int InvokeGtkWindowKeyEventCallbackFunction( struct WindowCallbackContext *win_callback_ctx );

int AddWindowMouseButtonEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , char *event_name , struct ZlangObject *funcp );
bool OnGtkWindowMouseButtonEventProc( GtkGestureClick *gesture , int n_press , double x , double y , gpointer user_data );
int InvokeGtkWindowMouseButtonEventCallbackFunction( struct WindowCallbackContext *win_callback_ctx );

int SetWindowStateEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkWindowStateEventProc( GtkWidget *widget , GParamSpec *pspec , gpointer user_data );
int InvokeGtkWindowStateEventCallbackFunction( struct WindowCallbackContext *win_callback_ctx );

int SetCloseWindowEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , char *event_name , struct ZlangObject *funcp );
gboolean OnGtkCloseWindowEventProc( GtkWidget *widget , gpointer data );
gboolean OnGtkCloseWindowEventProcDefault( GtkWidget *widget , gpointer data );
int InvokeGtkCloseWindowEventCallbackFunction( struct WindowCallbackContext *win_callback_ctx );

gboolean OnGtkWindowTimerEventProc( gpointer data );
int InvokeGtkWindowTimerEventCallbackFunction( struct WindowCallbackContext *win_callback_ctx );

/*
 * layout
 */

/*
struct ZlangDirectProperty_guilayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;
*/

struct ZlangDirectProperty_guifixedlayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateFixedLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guifixedlayout *guifixedlayout_direct_prop );

struct ZlangDirectProperty_guiboxlayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateBoxLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guiboxlayout *guiboxlayout_direct_prop , int32_t orientation , int32_t spacing_width );

struct ZlangDirectProperty_guicenterboxlayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateCenterBoxLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guicenterboxlayout *guicenterboxlayout_direct_prop , int32_t orientation );

struct ZlangDirectProperty_guiflowboxlayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;

	GtkFlowBoxChild					*child_activated_widget ;
} ;

int CreateFlowBoxLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guiflowboxlayout *guiflowboxlayout_direct_prop , int32_t row_spacing , int32_t column_spacing );

struct ZlangDirectProperty_guigridlayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateGridLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guigridlayout *guigridlayout_direct_prop , int32_t column_spacing , int32_t row_spacing );

struct ZlangDirectProperty_guiscrollwindowlayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateScrollWindowLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guiscrollwindowlayout *guiscrollwindowlayout_direct_prop );

struct ZlangDirectProperty_guiframelayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateFrameLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guiframelayout *guiframelayout_direct_prop , char *frame_label );

struct ZlangDirectProperty_guipanedlayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreatePanedLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guipanedlayout *guipanedlayout_direct_prop , int orientation_type , int ctl_1_width , struct ZlangDirectProperty_guiwidget_common *guiwidget_common_1 , struct ZlangDirectProperty_guiwidget_common *guiwidget_common_2 );

struct ZlangDirectProperty_guinotebooklayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateNotebookLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guinotebooklayout *guinotebooklayout_direct_prop );

struct ZlangDirectProperty_guipopoverlayout
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreatePopoverLayout( struct ZlangRuntime *rt , struct ZlangDirectProperty_guipopoverlayout *guipopoverlayout_direct_prop );

#define ZLANG_INVOKE_FUNCTION_guilayout_all_common_functions(_widget_) \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guilayout_all_common_functions(_widget_) \

/*
 * control
 */

struct ZlangDirectProperty_guictl
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

#define INIT_ZLANGDIRECTPROPERTY_guiwidget_common(_widget_) \
	{ \
		INIT_LIST_HEAD( & (_widget_##_prop->common.ctl_set_enable_to_ctl_list) ); \
	} \

#define CLEAN_ZLANGDIRECTPROPERTY_guiwidget_common(_widget_) \
	{ \
		struct StringListNode	*c2c = NULL ; \
		struct StringListNode	*next_c2c = NULL ; \
		\
		list_for_each_entry_safe( c2c , next_c2c , & (_widget_##_direct_prop->common.ctl_set_enable_to_ctl_list) , struct StringListNode , str_list_node ) \
		{ \
			UnlinkStringListNode( c2c ); \
		} \
	} \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetTooltip_string(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetTooltip_string; \
	int ZlangInvokeFunction_gui##_widget_##_SetTooltip_string( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		char						*tooltip_name = NULL ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		\
		CallRuntimeFunction_string_GetStringValue( rt , in1 , & tooltip_name , NULL ); \
		gtk_widget_set_tooltip_text( guiwidget_common->gtk_widget , tooltip_name ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetTooltip_string(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetTooltip_string , ZLANG_OBJECT_gui##_widget_ , "SetTooltip" , ZLANG_OBJECT_string,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetVisible_bool(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetVisible_bool; \
	int ZlangInvokeFunction_gui##_widget_##_SetVisible_bool( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		unsigned char					b ; \
		\
		CallRuntimeFunction_bool_GetBoolValue( rt , in1 , & b ); \
		gtk_widget_set_visible( guiwidget_common->gtk_widget , b ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetVisible_bool(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetVisible_bool , ZLANG_OBJECT_gui##_widget_ , "SetVisible" , ZLANG_OBJECT_bool,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetFocusable_bool(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetFocusable_bool; \
	int ZlangInvokeFunction_gui##_widget_##_SetFocusable_bool( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		unsigned char					b ; \
		\
		CallRuntimeFunction_bool_GetBoolValue( rt , in1 , & b ); \
		gtk_widget_set_focusable( guiwidget_common->gtk_widget , b ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetFocusable_bool(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetFocusable_bool , ZLANG_OBJECT_gui##_widget_ , "SetFocusable" , ZLANG_OBJECT_bool,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetEnable_bool(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetEnable_bool; \
	int ZlangInvokeFunction_gui##_widget_##_SetEnable_bool( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		unsigned char					b ; \
		\
		CallRuntimeFunction_bool_GetBoolValue( rt , in1 , & b ); \
		\
		gtk_widget_set_sensitive( guiwidget_common->gtk_widget , b ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetEnable_bool(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetEnable_bool , ZLANG_OBJECT_gui##_widget_ , "SetEnable" , ZLANG_OBJECT_bool,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetEnableTo_string(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetEnableTo_string; \
	int ZlangInvokeFunction_gui##_widget_##_SetEnableTo_string( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		char						*guiwidget_name = NULL ; \
		char						*guito_name = NULL ; \
		struct WindowCallbackControl			*win_callback_ctl = NULL ; \
		void						*guito_direct_prop = NULL ; \
		struct ZlangDirectProperty_guiwidget_common	*guito_common = NULL ; \
		unsigned char					is_checked ; \
		int						nret = 0 ; \
		\
		CallRuntimeFunction_string_GetStringValue( rt , in1 , & guito_name , NULL ); \
		\
		guiwidget_name = GetObjectName( obj ) ; \
		if( guiwidget_name == NULL || guiwidget_name[0] == '\0' ) \
		{ \
			UnreferObject( rt , out1 ); \
			return nret; \
		} \
		\
		win_callback_ctl = GetControlByName( guiwidget_common->guiwindow_obj , guito_name ) ; \
		if( win_callback_ctl == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return nret; \
		} \
		guito_direct_prop = GetObjectDirectProperty( win_callback_ctl->guictl_obj ) ;\
		guito_common = (struct ZlangDirectProperty_guiwidget_common *)guito_direct_prop ; \
		\
		is_checked = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(guito_common->gtk_widget) ) ; \
		gtk_widget_set_sensitive( guiwidget_common->gtk_widget , is_checked ) ; \
		\
		g_signal_connect( guito_common->gtk_widget , GTK_EVENT_TOGGLED , G_CALLBACK(OnGtkRadioButtonToggleEventProc) , win_callback_ctl ); \
		nret = AppendStringList( & (guito_common->ctl_set_enable_to_ctl_list) , guiwidget_name ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			return nret; \
		} \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetEnableTo_string(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetEnableTo_string , ZLANG_OBJECT_gui##_widget_ , "SetEnableTo" , ZLANG_OBJECT_string,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetFocus(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetFocus; \
	int ZlangInvokeFunction_gui##_widget_##_SetFocus( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		\
		gtk_widget_grab_focus( guiwidget_common->gtk_widget ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetFocus(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetFocus , ZLANG_OBJECT_gui##_widget_ , "SetFocus" , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_GetControlName(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_GetControlName; \
	int ZlangInvokeFunction_gui##_widget_##_GetControlName( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *) gui##_widget_##_direct_prop ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		char						*obj_name = NULL ; \
		\
		obj_name = g_object_get_data( (GObject*)(guiwidget_common->gtk_widget) , WIDGET_ZOBJECT_NAME ); \
		CallRuntimeFunction_string_SetStringValue( rt , out1 , obj_name , STRLEN_OF_STRING ); \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetControlName(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_GetControlName , ZLANG_OBJECT_string , "GetControlName" , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_IsVisible(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_IsVisible; \
	int ZlangInvokeFunction_gui##_widget_##_IsVisible( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject			*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		unsigned char				b ; \
		\
		b = gtk_widget_is_visible( GTK_WIDGET(gui##_widget_##_direct_prop->common.gtk_widget) ); \
		CallRuntimeFunction_bool_SetBoolValue( rt , out1 , b ); \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_IsVisible(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_IsVisible , ZLANG_OBJECT_bool , "IsVisible" , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_IsEnable(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_IsEnable; \
	int ZlangInvokeFunction_gui##_widget_##_IsEnable( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject			*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		unsigned char				b ; \
		\
		b = gtk_widget_get_sensitive( GTK_WIDGET(gui##_widget_##_direct_prop->common.gtk_widget) ); \
		CallRuntimeFunction_bool_SetBoolValue( rt , out1 , b ); \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_IsEnable(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_IsEnable , ZLANG_OBJECT_bool , "IsEnable" , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetKeyPressEventCallback_functionptr(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetKeyPressEventCallback_functionptr; \
	int ZlangInvokeFunction_gui##_widget_##_SetKeyPressEventCallback_functionptr( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *) gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		\
		AddControlKeyEventCallback( rt , guiwidget_common->guiwindow_obj , obj , GTK_EVENT_KEY_PRESSED , in1 ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetKeyPressEventCallback_functionptr(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetKeyPressEventCallback_functionptr , ZLANG_OBJECT_gui##_widget_ , "SetKeyPressEventCallback" , ZLANG_OBJECT_functionptr,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetKeyReleaseEventCallback_functionptr(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetKeyReleaseEventCallback_functionptr; \
	int ZlangInvokeFunction_gui##_widget_##_SetKeyReleaseEventCallback_functionptr( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *) gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		\
		AddControlKeyEventCallback( rt , guiwidget_common->guiwindow_obj , obj , GTK_EVENT_KEY_RELEASED , in1 ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetKeyReleaseEventCallback_functionptr(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetKeyReleaseEventCallback_functionptr , ZLANG_OBJECT_gui##_widget_ , "SetKeyReleaseEventCallback" , ZLANG_OBJECT_functionptr,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetMouseButtonPressEventCallback_functionptr(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetMouseButtonPressEventCallback_functionptr; \
	int ZlangInvokeFunction_gui##_widget_##_SetMouseButtonPressEventCallback_functionptr( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *) gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		\
		AddControlMouseButtonEventCallback( rt , guiwidget_common->guiwindow_obj , obj , GTK_EVENT_PRESSED , in1 ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetMouseButtonPressEventCallback_functionptr(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetMouseButtonPressEventCallback_functionptr , ZLANG_OBJECT_gui##_widget_ , "SetMouseButtonPressEventCallback" , ZLANG_OBJECT_functionptr,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetMouseButtonReleaseEventCallback_functionptr(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetMouseButtonReleaseEventCallback_functionptr; \
	int ZlangInvokeFunction_gui##_widget_##_SetMouseButtonReleaseEventCallback_functionptr( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_		*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *) gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		\
		AddControlMouseButtonEventCallback( rt , guiwidget_common->guiwindow_obj , obj , GTK_EVENT_RELEASED , in1 ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetMouseButtonReleaseEventCallback_functionptr(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetMouseButtonReleaseEventCallback_functionptr , ZLANG_OBJECT_gui##_widget_ , "SetMouseButtonReleaseEventCallback" , ZLANG_OBJECT_functionptr,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guictl_all_common_functions(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetTooltip_string(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetVisible_bool(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetFocusable_bool(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetEnable_bool(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetEnableTo_string(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetFocus(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_GetControlName(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_IsVisible(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_IsEnable(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetKeyPressEventCallback_functionptr(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetKeyReleaseEventCallback_functionptr(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetMouseButtonPressEventCallback_functionptr(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetMouseButtonReleaseEventCallback_functionptr(_widget_) \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guictl_all_common_functions(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetTooltip_string(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetVisible_bool(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetFocusable_bool(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetEnable_bool(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetEnableTo_string(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetFocus(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetControlName(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_IsVisible(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_IsEnable(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetKeyPressEventCallback_functionptr(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetKeyReleaseEventCallback_functionptr(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetMouseButtonPressEventCallback_functionptr(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetMouseButtonReleaseEventCallback_functionptr(_widget_) \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetName_string(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetName_string; \
	int ZlangInvokeFunction_gui##_widget_##_SetName_string( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*guiwidget_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		char						*obj_name = NULL ; \
		int						nret = 0 ; \
		\
		CallRuntimeFunction_string_GetStringValue( rt , in1 , & obj_name , NULL ); \
		\
		nret = ReferObject( rt , out1 , obj ) ; \
		if( nret ) \
		{ \
			TEST_RUNTIME_DEBUG_THEN_PRINT( rt , "ReferObjectInLocalStack failed[%d]" , nret ) \
			return ThrowErrorException( rt , GetRuntimeErrorNo(rt) , EXCEPTION_MESSAGE_REFER_OBJECT_FAILED ); \
		} \
		\
		obj_name = g_strdup( obj_name ) ; \
		if( obj_name == NULL ) \
		{ \
			TEST_RUNTIME_DEBUG_THEN_PRINT( rt , "g_strdup failed" ) \
			return ThrowErrorException( rt , ZLANG_ERROR_ALLOC , EXCEPTION_MESSAGE_ALLOC_FAILED ); \
		} \
		\
		nret = SetObjectName( rt , out1 , obj_name ) ; \
		if( nret ) \
		{ \
			TEST_RUNTIME_DEBUG_THEN_PRINT( rt , "SetObjectName failed[%d]" , nret ) \
			return ThrowErrorException( rt , GetRuntimeErrorNo(rt) , EXCEPTION_MESSAGE_SET_OBJECT_NAME_FAILED ); \
		} \
		\
		g_object_set_data_full( (GObject*)(guiwidget_common->gtk_widget) , WIDGET_ZOBJECT_NAME , obj_name , g_free ); \
		\
		nret = RegisteControlToWindow( rt , guiwidget_common->guiwindow_obj , out1 ) ; \
		if( nret ) \
		{ \
			return nret; \
		} \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetName_string(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetName_string , ZLANG_OBJECT_gui##_widget_ , "SetName" , ZLANG_OBJECT_string,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetSize_int_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetSize_int_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetSize_int_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*in2 = GetInputParameterInLocalObjectStack(rt,2) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int32_t						width ; \
		int32_t						height ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & width ); \
		CallRuntimeFunction_int_GetIntValue( rt , in2 , & height ); \
		\
		gtk_widget_set_size_request( gui##_widget_##_direct_prop->common.gtk_widget , width , height ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetSize_int_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetSize_int_int , ZLANG_OBJECT_gui##_widget_ , "SetSize" , ZLANG_OBJECT_int,NULL , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetWidth_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetWidth_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetWidth_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject			*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject			*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int32_t					width ; \
		int32_t					height ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & width ); \
		\
		height = gtk_widget_get_allocated_height( GTK_WIDGET(gui##_widget_##_direct_prop->common.gtk_widget) ); \
		gtk_widget_set_size_request( gui##_widget_##_direct_prop->common.gtk_widget , width , height ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetWidth_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetWidth_int , ZLANG_OBJECT_gui##_widget_ , "SetWidth" , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetHeight_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetHeight_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetHeight_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int32_t						height ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & height ); \
		\
		height = gtk_widget_get_allocated_height( GTK_WIDGET(gui##_widget_##_direct_prop->common.gtk_widget) ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetHeight_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetHeight_int , ZLANG_OBJECT_gui##_widget_ , "SetHeight" , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_GetWidth(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_GetWidth; \
	int ZlangInvokeFunction_gui##_widget_##_GetWidth( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject			*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int32_t					width ; \
		\
		width = gtk_widget_get_allocated_width( GTK_WIDGET(gui##_widget_##_direct_prop->common.gtk_widget) ); \
		CallRuntimeFunction_int_SetIntValue( rt , out1 , width ); \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetWidth(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_GetWidth , ZLANG_OBJECT_int , "GetWidth" , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_GetHeight(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_GetHeight; \
	int ZlangInvokeFunction_gui##_widget_##_GetHeight( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject			*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int32_t					height ; \
		\
		height = gtk_widget_get_allocated_height( GTK_WIDGET(gui##_widget_##_direct_prop->common.gtk_widget) ); \
		CallRuntimeFunction_int_SetIntValue( rt , out1 , height ); \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetHeight(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_GetHeight , ZLANG_OBJECT_int , "GetHeight" , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetHorizontalExpand_bool(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetHorizontalExpand_bool; \
	int ZlangInvokeFunction_gui##_widget_##_SetHorizontalExpand_bool( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject			*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject			*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		unsigned char				hexpend ; \
		\
		CallRuntimeFunction_bool_GetBoolValue( rt , in1 , & hexpend ); \
		\
		gtk_widget_set_hexpand( gui##_widget_##_direct_prop->common.gtk_widget , hexpend ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetHorizontalExpand_bool(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetHorizontalExpand_bool , ZLANG_OBJECT_gui##_widget_ , "SetHorizontalExpand" , ZLANG_OBJECT_bool,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetVerticalExpand_bool(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetVerticalExpand_bool; \
	int ZlangInvokeFunction_gui##_widget_##_SetVerticalExpand_bool( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject			*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject			*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		unsigned char				vexpend ; \
		\
		CallRuntimeFunction_bool_GetBoolValue( rt , in1 , & vexpend ); \
		\
		gtk_widget_set_vexpand( gui##_widget_##_direct_prop->common.gtk_widget , vexpend ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetVerticalExpand_bool(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetVerticalExpand_bool , ZLANG_OBJECT_gui##_widget_ , "SetVerticalExpand" , ZLANG_OBJECT_bool,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetExpand_bool(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetExpand_bool; \
	int ZlangInvokeFunction_gui##_widget_##_SetExpand_bool( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		unsigned char					expend ; \
		\
		CallRuntimeFunction_bool_GetBoolValue( rt , in1 , & expend ); \
		\
		gtk_widget_set_hexpand( gui##_widget_##_direct_prop->common.gtk_widget , expend ); \
		gtk_widget_set_vexpand( gui##_widget_##_direct_prop->common.gtk_widget , expend ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetExpand_bool(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetExpand_bool , ZLANG_OBJECT_gui##_widget_ , "SetExpand" , ZLANG_OBJECT_bool,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetHorizontalAlign_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetHorizontalAlign_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetHorizontalAlign_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int						halign ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & halign ); \
		\
		gtk_widget_set_halign( gui##_widget_##_direct_prop->common.gtk_widget , halign ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetHorizontalAlign_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetHorizontalAlign_int , ZLANG_OBJECT_gui##_widget_ , "SetHorizontalAlign" , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetVerticalAlign_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetVerticalAlign_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetVerticalAlign_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int						valign ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & valign ); \
		\
		gtk_widget_set_valign( gui##_widget_##_direct_prop->common.gtk_widget , valign ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetVerticalAlign_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetVerticalAlign_int , ZLANG_OBJECT_gui##_widget_ , "SetVerticalAlign" , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetAlign_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetAlign_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetAlign_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int						align ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & align ); \
		\
		gtk_widget_set_halign( gui##_widget_##_direct_prop->common.gtk_widget , align ); \
		gtk_widget_set_valign( gui##_widget_##_direct_prop->common.gtk_widget , align ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetAlign_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetAlign_int , ZLANG_OBJECT_gui##_widget_ , "SetAlign" , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetMargin_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetMargin_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetMargin_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int						margin ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & margin ); \
		\
		SetGtkWidgetMarginWidth( gui##_widget_##_common->gtk_widget , margin ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetMargin_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetMargin_int , ZLANG_OBJECT_gui##_widget_ , "SetMargin" , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetMargin_int_int_int_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetMargin_int_int_int_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetMargin_int_int_int_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*in2 = GetInputParameterInLocalObjectStack(rt,2) ; \
		struct ZlangObject				*in3 = GetInputParameterInLocalObjectStack(rt,3) ; \
		struct ZlangObject				*in4 = GetInputParameterInLocalObjectStack(rt,4) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int						top_margin ; \
		int						bottom_margin ; \
		int						left_margin ; \
		int						right_margin ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & top_margin ); \
		CallRuntimeFunction_int_GetIntValue( rt , in2 , & bottom_margin ); \
		CallRuntimeFunction_int_GetIntValue( rt , in3 , & left_margin ); \
		CallRuntimeFunction_int_GetIntValue( rt , in4 , & right_margin ); \
		\
		SetGtkWidgetMarginAllWidth( gui##_widget_##_common->gtk_widget , top_margin ,bottom_margin , left_margin , right_margin ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetMargin_int_int_int_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetMargin_int , ZLANG_OBJECT_gui##_widget_ , "SetMargin" , ZLANG_OBJECT_int,NULL , ZLANG_OBJECT_int,NULL , ZLANG_OBJECT_int,NULL , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetHorizontalMargin_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetHorizontalMargin_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetHorizontalMargin_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int						horizon_margin ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & horizon_margin ); \
		\
		SetGtkWidgetHorizontalMarginWidth( gui##_widget_##_common->gtk_widget , horizon_margin ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetHorizontalMargin_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetHorizontalMargin_int , ZLANG_OBJECT_gui##_widget_ , "SetHorizontalMargin" , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetVerticalMargin_int(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetVerticalMargin_int; \
	int ZlangInvokeFunction_gui##_widget_##_SetVerticalMargin_int( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int						horizon_margin ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & horizon_margin ); \
		\
		SetGtkWidgetVerticalMarginWidth( gui##_widget_##_common->gtk_widget , horizon_margin ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetVerticalMargin_int(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetVerticalMargin_int , ZLANG_OBJECT_gui##_widget_ , "SetVerticalMargin" , ZLANG_OBJECT_int,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetCss_string(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetCss_string; \
	int ZlangInvokeFunction_gui##_widget_##_SetCss_string( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		char						*css_str = NULL ; \
		int32_t						css_str_len ; \
		GtkCssProvider					*css_provider = NULL ; \
		\
		CallRuntimeFunction_string_GetStringValue( rt , in1 , & css_str , & css_str_len ); \
		\
		css_provider = gtk_css_provider_new() ; \
		gtk_css_provider_load_from_data( css_provider , css_str , css_str_len ); \
		gtk_style_context_add_provider( gtk_widget_get_style_context(gui##_widget_##_common->gtk_widget) , GTK_STYLE_PROVIDER(css_provider) , GTK_STYLE_PROVIDER_PRIORITY_APPLICATION ); \
		g_object_unref( css_provider ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetCss_string(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetCss_string , ZLANG_OBJECT_gui##_widget_ , "SetCss" , ZLANG_OBJECT_string,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_Show(_ctl_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_ctl_##_Show; \
	int ZlangInvokeFunction_gui##_ctl_##_Show( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_ctl_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_ctl_##_direct_prop ; \
		\
		gtk_widget_show( gui##_widget_##_common->gtk_widget ); \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_Show(_ctl_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_ctl_##_Show , ZLANG_OBJECT_gui##_ctl_ , "Show" , ZLANG_OBJECT_void,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_Hide(_ctl_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_ctl_##_Hide; \
	int ZlangInvokeFunction_gui##_ctl_##_Hide( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_ctl_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_ctl_##_direct_prop ; \
		\
		gtk_widget_hide( gui##_widget_##_common->gtk_widget ); \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_Hide(_ctl_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_ctl_##_Hide , ZLANG_OBJECT_gui##_ctl_ , "Hide" , ZLANG_OBJECT_void,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_SetTag_string_string(_ctl_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_ctl_##_SetTag_string_string; \
	int ZlangInvokeFunction_gui##_ctl_##_SetTag_string_string( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_ctl_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_ctl_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*in2 = GetInputParameterInLocalObjectStack(rt,2) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		char						*tag_name = NULL ; \
		char						*tag_value = NULL ; \
		\
		CallRuntimeFunction_string_GetStringValue( rt , in1 , & tag_name , NULL ); \
		CallRuntimeFunction_string_GetStringValue( rt , in2 , & tag_value , NULL ); \
		\
		tag_value = g_strdup( tag_value ) ; \
		if( tag_value == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_ALLOC , EXCEPTION_MESSAGE_G_STRDUP_FAILED ); \
		} \
		\
		g_object_set_data_full( (GObject*)(gui##_widget_##_common->gtk_widget) , tag_name , tag_value , g_free ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetTag_string_string(_ctl_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_ctl_##_SetTag_string_string , ZLANG_OBJECT_gui##_ctl_ , "SetTag" , ZLANG_OBJECT_string,NULL , ZLANG_OBJECT_string,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_GetTag_string(_ctl_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_ctl_##_GetTag_string; \
	int ZlangInvokeFunction_gui##_ctl_##_GetTag_string( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_ctl_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_ctl_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		char						*tag_name = NULL ; \
		char						*tag_value = NULL ; \
		\
		CallRuntimeFunction_string_GetStringValue( rt , in1 , & tag_name , NULL ); \
		\
		tag_value = g_object_get_data( (GObject*)(gui##_widget_##_common->gtk_widget) , tag_name ); \
		if( tag_value == NULL ) \
			UnreferObject( rt , out1 ); \
		else \
			CallRuntimeFunction_string_SetStringValue( rt , out1 , tag_value , STRLEN_OF_STRING ); \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetTag_string(_ctl_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_ctl_##_GetTag_string , ZLANG_OBJECT_string , "GetTag" , ZLANG_OBJECT_string,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \
	
#define ZLANG_INVOKE_FUNCTION_guiwidget_GetParentWithType_object(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_GetParentWithType_object; \
	int ZlangInvokeFunction_gui##_widget_##_GetParentWithType_object( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		GtkWidget					*gtk_parent_widget = NULL ; \
		void						*type_guictl_obj_direct_prop = GetObjectDirectProperty(in1) ; \
		struct ZlangDirectProperty_guiwidget_common	*type_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)type_guictl_obj_direct_prop ; \
		struct ZlangObject				*clone_guictl_obj = NULL ; \
		struct ZlangDirectProperty_guilayout		*clone_guictl_obj_direct_prop = NULL ; \
		struct ZlangDirectProperty_guiwidget_common	*clone_guictl_common = NULL ; \
		int						nret = 0 ; \
		\
		gtk_parent_widget = gtk_widget_get_parent( gui##_widget_##_common->gtk_widget ) ; \
		if( gtk_parent_widget == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_GET_PARENT_WIDGET_FAILED ); \
		} \
		\
		if( type_guictl_common->gtk_widget_type_id == 0 || type_guictl_common->gtk_widget_type_id != G_OBJECT_TYPE(gtk_parent_widget) ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_GTK_WIDGET_TYPE_NOT_MATCHED ); \
		} \
		\
		clone_guictl_obj = CloneObjectInTmpStack( rt , NULL , in1 ) ; \
		if( clone_guictl_obj == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_CLONE_OBJECT_FAILED ); \
		} \
		\
		clone_guictl_obj_direct_prop = GetObjectDirectProperty(clone_guictl_obj) ; \
		clone_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)clone_guictl_obj_direct_prop ; \
		clone_guictl_common->gtk_widget = gtk_parent_widget ; \
		clone_guictl_common->guiwindow_obj = gui##_widget_##_common->guiwindow_obj ; \
		\
		nret = ReferObject( rt , out1 , clone_guictl_obj ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_REFER_OBJECT_FAILED ); \
		} \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetParentWithType_object(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_GetParentWithType_object , ZLANG_OBJECT_object , "GetParentWithType" , ZLANG_OBJECT_object,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_GetParentWithType_int_object(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_GetParentWithType_int_object; \
	int ZlangInvokeFunction_gui##_widget_##_GetParentWithType_int_object( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*in2 = GetInputParameterInLocalObjectStack(rt,2) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		int32_t						jump_n ; \
		GtkWidget					*gtk_parent_widget = NULL ; \
		void						*type_guictl_obj_direct_prop = GetObjectDirectProperty(in2) ; \
		struct ZlangDirectProperty_guiwidget_common	*type_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)type_guictl_obj_direct_prop ; \
		struct ZlangObject				*clone_guictl_obj = NULL ; \
		struct ZlangDirectProperty_guilayout		*clone_guictl_obj_direct_prop = NULL ; \
		struct ZlangDirectProperty_guiwidget_common	*clone_guictl_common = NULL ; \
		int						nret = 0 ; \
		\
		CallRuntimeFunction_int_GetIntValue( rt , in1 , & jump_n ); \
		\
		gtk_parent_widget = gui##_widget_##_common->gtk_widget ; \
		while( (--jump_n) >= 0 ) \
		{ \
			gtk_parent_widget = gtk_widget_get_parent( gtk_parent_widget ) ; \
			if( gtk_parent_widget == NULL ) \
			{ \
				UnreferObject( rt , out1 ); \
				return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_GET_PARENT_WIDGET_FAILED ); \
			} \
		} \
		\
		if( type_guictl_common->gtk_widget_type_id == 0 || type_guictl_common->gtk_widget_type_id != G_OBJECT_TYPE(gtk_parent_widget) ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_GTK_WIDGET_TYPE_NOT_MATCHED ); \
		} \
		\
		clone_guictl_obj = CloneObjectInTmpStack( rt , NULL , in2 ) ; \
		if( clone_guictl_obj == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_CLONE_OBJECT_FAILED ); \
		} \
		\
		clone_guictl_obj_direct_prop = GetObjectDirectProperty(clone_guictl_obj) ; \
		clone_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)clone_guictl_obj_direct_prop ; \
		clone_guictl_common->gtk_widget = gtk_parent_widget ; \
		clone_guictl_common->guiwindow_obj = gui##_widget_##_common->guiwindow_obj ; \
		\
		nret = ReferObject( rt , out1 , clone_guictl_obj ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_REFER_OBJECT_FAILED ); \
		} \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetParentWithType_int_object(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_GetParentWithType_int_object , ZLANG_OBJECT_object , "GetParentWithType" , ZLANG_OBJECT_int,NULL , ZLANG_OBJECT_object,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_QueryParentWithType_object(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_QueryParentWithType_object; \
	int ZlangInvokeFunction_gui##_widget_##_QueryParentWithType_object( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_ctl_		*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		GtkWidget					*gtk_parent_widget = NULL ; \
		void						*type_guictl_obj_direct_prop = GetObjectDirectProperty(in1) ; \
		struct ZlangDirectProperty_guiwidget_common	*type_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)type_guictl_obj_direct_prop ; \
		struct ZlangObject				*clone_guictl_obj = NULL ; \
		struct ZlangDirectProperty_guilayout		*clone_guictl_obj_direct_prop = NULL ; \
		struct ZlangDirectProperty_guiwidget_common	*clone_guictl_common = NULL ; \
		int						nret = 0 ; \
		\
		for( gtk_parent_widget = gtk_widget_get_parent(gui##_widget_##_common->gtk_widget) ; gtk_parent_widget ; gtk_parent_widget = gtk_widget_get_parent(gtk_parent_widget) ) \
		{ \
			if( type_guictl_common->gtk_widget_type_id && type_guictl_common->gtk_widget_type_id == G_OBJECT_TYPE(gtk_parent_widget) ) \
			{ \
				break; \
			} \
		} \
		if( gtk_parent_widget == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_QUERY_PARENT_WIDGET_NOT_FOUND ); \
		} \
		\
		clone_guictl_obj = CloneObjectInTmpStack( rt , NULL , in1 ) ; \
		if( clone_guictl_obj == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_CLONE_OBJECT_FAILED ); \
		} \
		\
		clone_guictl_obj_direct_prop = GetObjectDirectProperty(clone_guictl_obj) ; \
		clone_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)clone_guictl_obj_direct_prop ; \
		clone_guictl_common->gtk_widget = gtk_parent_widget ; \
		clone_guictl_common->guiwindow_obj = gui##_widget_##_common->guiwindow_obj ; \
		\
		nret = ReferObject( rt , out1 , clone_guictl_obj ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_REFER_OBJECT_FAILED ); \
		} \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_QueryParentWithType_object(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_QueryParentWithType_object , ZLANG_OBJECT_object , "QueryParentWithType" , ZLANG_OBJECT_object,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_IsChildType_object(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_IsChildType_object; \
	int ZlangInvokeFunction_gui##_widget_##_IsChildType_object( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangDirectProperty_guiwidget_common	*in_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)GetObjectDirectProperty(in1) ; \
		GtkWidget					*gtk_child_widget = NULL ; \
		GType						gtk_child_widget_type ; \
		\
		gtk_child_widget = gtk_widget_get_first_child( gui##_widget_##_common->gtk_widget ); \
		if( gtk_child_widget == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_GET_CHILD_WIDGET_FAILED ); \
		} \
		\
		gtk_child_widget_type = G_OBJECT_TYPE( gtk_child_widget ) ; \
		if( in_guictl_common->gtk_widget_type_id && gtk_child_widget_type ) \
			CallRuntimeFunction_bool_SetBoolValue( rt , out1 , TRUE ); \
		else \
			CallRuntimeFunction_bool_SetBoolValue( rt , out1 , FALSE ); \
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_IsChildType_object(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_IsChildType_object , ZLANG_OBJECT_bool , "IsChildType" , ZLANG_OBJECT_object,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_GetChildWithType_object(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_GetChildWithType_object; \
	int ZlangInvokeFunction_gui##_widget_##_GetChildWithType_object( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		GtkWidget					*gtk_child_widget = NULL ; \
		void						*type_guictl_obj_direct_prop = GetObjectDirectProperty(in1) ; \
		struct ZlangDirectProperty_guiwidget_common	*type_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)type_guictl_obj_direct_prop ; \
		struct ZlangObject				*clone_guictl_obj = NULL ; \
		struct ZlangDirectProperty_guiwidget_common	*clone_guictl_obj_direct_prop = NULL ; \
		int						nret = 0 ; \
		\
		gtk_child_widget = gtk_widget_get_first_child( gui##_widget_##_common->gtk_widget ); \
		if( gtk_child_widget == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_GET_CHILD_WIDGET_FAILED ); \
		} \
		\
		if( type_guictl_common->gtk_widget_type_id == 0 || type_guictl_common->gtk_widget_type_id != G_OBJECT_TYPE(gtk_child_widget) ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_GTK_WIDGET_TYPE_NOT_MATCHED ); \
		} \
		\
		clone_guictl_obj = CloneObjectInTmpStack( rt , NULL , in1 ) ; \
		if( clone_guictl_obj == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_CLONE_OBJECT_FAILED ); \
		} \
		\
		clone_guictl_obj_direct_prop = GetObjectDirectProperty(clone_guictl_obj) ; \
		clone_guictl_obj_direct_prop->gtk_widget = gtk_child_widget ; \
		clone_guictl_obj_direct_prop->guiwindow_obj = gui##_widget_##_common->guiwindow_obj ; \
		\
		nret = ReferObject( rt , out1 , clone_guictl_obj ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_REFER_OBJECT_FAILED ); \
		} \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetChildWithType_object(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_GetChildWithType_object , ZLANG_OBJECT_object , "GetChildWithType" , ZLANG_OBJECT_object,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

GtkWidget *TravelSlibingAndChildWidgets_QueryChildWithType( GType gtk_widget_type_id , GtkWidget *widget );

#define ZLANG_INVOKE_FUNCTION_guiwidget_QueryChildWithType_object(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_QueryChildWithType_object; \
	int ZlangInvokeFunction_gui##_widget_##_QueryChildWithType_object( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *)gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		GtkWidget					*gtk_child_widget = NULL ; \
		void						*type_guictl_obj_direct_prop = GetObjectDirectProperty(in1) ; \
		struct ZlangDirectProperty_guiwidget_common	*type_guictl_common = (struct ZlangDirectProperty_guiwidget_common *)type_guictl_obj_direct_prop ; \
		struct ZlangObject				*clone_guictl_obj = NULL ; \
		struct ZlangDirectProperty_guiwidget_common	*clone_guictl_obj_direct_prop = NULL ; \
		int						nret = 0 ; \
		\
		if( type_guictl_common->gtk_widget_type_id == 0 ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_QUERY_CHILD_WIDGET_NOT_FOUND ); \
		} \
		\
		gtk_child_widget = TravelSlibingAndChildWidgets_QueryChildWithType( type_guictl_common->gtk_widget_type_id , gtk_widget_get_first_child(gui##_widget_##_common->gtk_widget) ) ; \
		if( gtk_child_widget == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_QUERY_CHILD_WIDGET_NOT_FOUND ); \
		} \
		\
		clone_guictl_obj = CloneObjectInTmpStack( rt , NULL , in1 ) ; \
		if( clone_guictl_obj == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_CLONE_OBJECT_FAILED ); \
		} \
		\
		clone_guictl_obj_direct_prop = GetObjectDirectProperty(clone_guictl_obj) ; \
		clone_guictl_obj_direct_prop->gtk_widget = gtk_child_widget ; \
		clone_guictl_obj_direct_prop->guiwindow_obj = gui##_widget_##_common->guiwindow_obj ; \
		\
		nret = ReferObject( rt , out1 , clone_guictl_obj ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_INVOKE_METHOD_RETURN , EXCEPTION_MESSAGE_REFER_OBJECT_FAILED ); \
		} \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_QueryChildWithType_object(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_QueryChildWithType_object , ZLANG_OBJECT_object , "QueryChildWithType" , ZLANG_OBJECT_object,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetFocusInEventCallback_functionptr(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_ctl_##_SetFocusInEventCallback_functionptr; \
	int ZlangInvokeFunction_gui##_widget_##_SetFocusInEventCallback_functionptr( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *) gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		\
		AddControlFocusEventCallback( rt , gui##_widget_##_common->guiwindow_obj , obj , GTK_EVENT_ENTER , in1 ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetFocusInEventCallback_functionptr(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetFocusInEventCallback_functionptr , ZLANG_OBJECT_gui##_widget_ , "SetFocusInEventCallback" , ZLANG_OBJECT_functionptr,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_SetFocusOutEventCallback_functionptr(_widget_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_widget_##_SetFocusOutEventCallback_functionptr; \
	int ZlangInvokeFunction_gui##_widget_##_SetFocusOutEventCallback_functionptr( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_widget_	*gui##_widget_##_direct_prop = GetObjectDirectProperty(obj) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_widget_##_common = (struct ZlangDirectProperty_guiwidget_common *) gui##_widget_##_direct_prop ; \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		\
		AddControlFocusEventCallback( rt , gui##_widget_##_common->guiwindow_obj , obj , GTK_EVENT_LEAVE , in1 ); \
		\
		TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
		\
		return 0; \
	} \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetFocusOutEventCallback_functionptr(_widget_) \
	func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_widget_##_SetFocusOutEventCallback_functionptr , ZLANG_OBJECT_gui##_widget_ , "SetFocusOutEventCallback" , ZLANG_OBJECT_functionptr,NULL , NULL ) ; \
	if( func == NULL ) \
		return NULL; \

#define ZLANG_INVOKE_FUNCTION_guiwidget_all_common_functions(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetName_string(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetSize_int_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetWidth_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetHeight_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_GetWidth(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_GetHeight(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetHorizontalExpand_bool(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetVerticalExpand_bool(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetExpand_bool(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetHorizontalAlign_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetVerticalAlign_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetAlign_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetMargin_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetMargin_int_int_int_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetHorizontalMargin_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetVerticalMargin_int(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetCss_string(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_Show(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_Hide(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetTag_string_string(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_GetTag_string(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_GetParentWithType_object(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_GetParentWithType_int_object(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_QueryParentWithType_object(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_IsChildType_object( _widget_ ) \
	ZLANG_INVOKE_FUNCTION_guiwidget_GetChildWithType_object( _widget_ ) \
	ZLANG_INVOKE_FUNCTION_guiwidget_QueryChildWithType_object(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetFocusInEventCallback_functionptr(_widget_) \
	ZLANG_INVOKE_FUNCTION_guiwidget_SetFocusOutEventCallback_functionptr(_widget_) \

#define ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_all_common_functions(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetName_string(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetSize_int_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetWidth_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetHeight_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetWidth(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetHeight(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetHorizontalExpand_bool(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetVerticalExpand_bool(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetExpand_bool(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetHorizontalAlign_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetVerticalAlign_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetAlign_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetMargin_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetMargin_int_int_int_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetHorizontalMargin_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetVerticalMargin_int(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetCss_string(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_Show(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_Hide(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetTag_string_string(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetTag_string(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetParentWithType_object(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetParentWithType_int_object(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_QueryParentWithType_object(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_IsChildType_object( _widget_ ) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_GetChildWithType_object( _widget_ ) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_QueryChildWithType_object( _widget_ ) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetFocusInEventCallback_functionptr(_widget_) \
	ADD_FUNCTION_AND_PARAMETERS_IN_OBJECT_guiwidget_SetFocusOutEventCallback_functionptr(_widget_) \

struct ZlangDirectProperty_guimenubar
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateMenuBar( struct ZlangRuntime *rt , struct ZlangDirectProperty_guimenubar *guimenubar_direct_prop );

struct ZlangDirectProperty_guimenu
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guimenuitem
{
	struct ZlangDirectProperty_guiwidget_common	common ;

	char						la_bel[ 64 ] ;
	char						win_la_bel[ 64 ] ;
	unsigned char					is_checked ;
} ;

struct ZlangDirectProperty_guitoolbar
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int CreateToolBar( struct ZlangRuntime *rt , struct ZlangDirectProperty_guitoolbar *guitoolbar_direct_prop );

struct ZlangDirectProperty_guitoolseparatoritem
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guilabel
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guiedit
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

#define GUIWRAP_NONE		GTK_WRAP_NONE
#define GUIWRAP_CHAR		GTK_WRAP_CHAR
#define GUIWRAP_WORD		GTK_WRAP_WORD
#define GUIWRAP_WORD_CHAR	GTK_WRAP_WORD_CHAR

struct ZlangDirectProperty_guieditarea
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guisourceeditarea
{
	struct ZlangDirectProperty_guiwidget_common	common ;

	GtkTextIter					line_start ;
	GtkTextIter					line_end ;
	guint						has_more_lines ;
	guint						line_number ;

	GtkSourceSearchSettings				*settings ;
	GtkSourceSearchContext				*context ;
} ;

#define GUIBUTTONS_OK			GTK_BUTTONS_OK
#define GUIBUTTONS_OK_CANCEL		GTK_BUTTONS_OK_CANCEL
#define GUIBUTTONS_YES_NO		GTK_BUTTONS_YES_NO
#define GUIBUTTONS_CANCEL		GTK_BUTTONS_CANCEL
#define GUIBUTTONS_CLOSE		GTK_BUTTONS_CLOSE
#define GUIBUTTONS_YES_NO_CANCEL	(GTK_BUTTONS_YES_NO*10+GTK_BUTTONS_CANCEL)

#define GUIBUTTON_ACCEPT		GTK_RESPONSE_ACCEPT
#define GUIBUTTON_OK			GTK_RESPONSE_OK
#define GUIBUTTON_CANCEL		GTK_RESPONSE_CANCEL
#define GUIBUTTON_YES			GTK_RESPONSE_YES
#define GUIBUTTON_NO			GTK_RESPONSE_NO
#define GUIBUTTON_CLOSE			GTK_RESPONSE_CLOSE

struct ZlangDirectProperty_guibutton
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guispinbutton
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guicheckbutton
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

void OnGtkRadioButtonToggleEventProc( GtkWidget *widget , gpointer data );

struct ZlangDirectProperty_guiradiobutton
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitogglebutton
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guilinkbutton
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guilistbox
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guicombobox
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

#define GUISELECTION_MODAL_SINGLE	1
#define GUISELECTION_MODAL_MULTI	2

struct ZlangDirectProperty_guitable
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitablecolumn_int_text
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitablecolumn_double_text
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitablecolumn_string_text
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitablecolumn_icon
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitreetable
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitreenode
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitreecolumn_toggle
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitreecolumn_progress
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitreecolumn_int_text
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitreecolumn_double_text
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guitreecolumn_string_text
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guilevelbar
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guiprogressbar
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guicalendar
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guiimage
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guiswitch
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guivideo
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

struct ZlangDirectProperty_guiseparator
{
	struct ZlangDirectProperty_guiwidget_common	common ;
} ;

int RegisteControlToWindow( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj );
struct WindowCallbackControl *GetControlByName( struct ZlangObject *win_obj , char *search_obj_name );

int AddControlGeneralEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkControlGeneralEventProc( GtkWidget *widget , gpointer data );
int InvokeGtkControlGeneralEventCallbackFunction( struct ControlCallbackContext *ctl_callback_ctx );

int AddControlFocusEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *event_name , struct ZlangObject *funcp );
int AddControlUnfocusEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkControlFocusEventProc( GtkWidget *widget , gpointer data );
void OnGtkControlUnfocusEventProc( GtkWidget *widget , gpointer data );

int AddControlKeyEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *event_name , struct ZlangObject *funcp );
gboolean OnGtkControlKeyEventProc( GtkWidget *widget , guint keyval , guint keycode , GdkModifierType state , gpointer data );
int InvokeGtkControlKeyEventCallbackFunction( struct ControlCallbackContext *ctl_callback_ctx_ctx );

int AddControlMouseButtonEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkControlMouseButtonEventProc( GtkGestureClick *gesture , int n_press , double x , double y , gpointer data );
int InvokeGtkControlMouseButtonEventCallbackFunction( struct ControlCallbackContext *ctl_callback_ctx );

int AddControlNotifyEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkControlNotifyEventProc( GtkWidget *widget , GParamSpec *pspec , gpointer data );
int InvokeGtkControlNotifyEventCallbackFunction( struct ControlCallbackContext *ctl_callback_ctx );

int AddControlListboxRowEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkControlListboxRowEventProc( GtkWidget *widget , GtkListBoxRow *row , gpointer data );
int InvokeGtkControlListboxRowEventCallbackFunction( struct ControlCallbackContext *ctl_callback_ctx );

int AddControlFlowboxChildActivatedEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *event_name , struct ZlangObject *funcp );
void OnGtkControlFlowboxChildActivatedEventProc( GtkFlowBox *flow_box , GtkFlowBoxChild *child , gpointer user_data );
int InvokeGtkControlFlowboxChildActivatedEventCallbackFunction( struct ControlCallbackContext *ctl_callback_ctx );

int AddMenuItemEventCallback( struct ZlangRuntime *rt , struct ZlangObject *guiwindow_obj , struct ZlangObject *guictl_obj , char *label , char *event_name , struct ZlangObject *funcp );
void OnGtkMenuItemEventProc( GSimpleAction *action , GVariant *parameter , gpointer data );
int InvokeGtkMenuItemEventCallbackFunction( struct ControlCallbackContext *ctl_callback_ctx );

#define GUIDIALOG_TYPE_INFO	GTK_MESSAGE_INFO
#define GUIDIALOG_TYPE_WARNING	GTK_MESSAGE_WARNING
#define GUIDIALOG_TYPE_ERROR	GTK_MESSAGE_ERROR
#define GUIDIALOG_TYPE_QUESTION	GTK_MESSAGE_QUESTION

struct ZlangDirectProperty_guimessagedialog
{
	GtkWidget			*gtk_dialog ;

	int				response ;
} ;

struct ZlangDirectProperty_guiaboutdialog
{
	GtkWidget			*gtk_dialog ;
} ;

struct ZlangDirectProperty_guicolorchooserdialog
{
	GtkWidget			*gtk_dialog ;

	int				response ;

	int32_t				alpha ;
	int32_t				red ;
	int32_t				green ;
	int32_t				blue ;
} ;

#define GUIFILECHOOSERACTION_OPEN		GTK_FILE_CHOOSER_ACTION_OPEN
#define GUIFILECHOOSERACTION_SAVE		GTK_FILE_CHOOSER_ACTION_SAVE
#define GUIFILECHOOSERACTION_SELECT_FOLDER	GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER

struct ZlangDirectProperty_guifilechooserdialog
{
	GtkFileChooserNative		*gtk_dialog ;

	int				response ;

	char				pathfilename[ MAX_PATH ] ;
	char				filename[ MAX_PATH ] ;
} ;

struct ZlangDirectProperty_guifontchooserdialog
{
	GtkWidget			*gtk_dialog ;

	int				response ;

	char				font[ 64 ] ;
	char				font_family[ 64 ] ;
	char				font_face[ 64 ] ;
	int32_t				font_size ;
} ;

#define EVAL_GTK_WIDGET_NEW_IN_CREATE(_gtk_widget_,_gtk_widget_new_expr_) \
	{ \
		_gtk_widget_ = _gtk_widget_new_expr_ ; \
		if( _gtk_widget_ == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return ThrowErrorException( rt , ZLANG_ERROR_ALLOC , EXCEPTION_MESSAGE_NEW_GTK_OBJECT_FAILED ); \
		} \
	} \

#define SET_CONTROL_DEFAULT_STYLE(_win_obj_,_gtk_widget_) \
	{ \
		struct ZlangDirectProperty_guiwindow	*guiwindow_direct_prop = GetObjectDirectProperty(_win_obj_) ; \
		if( guiwindow_direct_prop->global_style.ctl_default_margin > 0 ) \
		{ \
			SetGtkWidgetMarginWidth( _gtk_widget_ , guiwindow_direct_prop->global_style.ctl_default_margin ); \
		} \
	} \

#define TRANSFER_INPUT_OBJECT_TO_NEW_OBJECT(_new_obj_,_in_obj_) \
	{ \
		_new_obj_ = TransferInputObjectToNewObject( rt , _in_obj_ ) ; \
		if( _new_obj_ == NULL ) \
		{ \
			UnreferObject( rt , out1 ); \
			return GetRuntimeErrorNo(rt); \
		} \
	} \

#define ADD_CONTROL_GENERAL_CALLBACK_IN_CREATE(_guiwindow_obj_,_guictl_obj_,_event_name_,_funcp_) \
	{ \
		int						nret = 0 ; \
		\
		nret = AddControlGeneralEventCallback( rt , _guiwindow_obj_ , _guictl_obj_ , _event_name_ , _funcp_ ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			QuitGtkMainLoop( _guiwindow_obj_ ); \
			return nret; \
		} \
	} \

#define ADD_CONTROL_NOTIFY_CALLBACK_IN_CREATE(_guiwindow_obj_,_guictl_obj_,_event_name_,_funcp_) \
	{ \
		int						nret = 0 ; \
		\
		nret = AddControlNotifyEventCallback( rt , _guiwindow_obj_ , _guictl_obj_ , _event_name_ , _funcp_ ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			QuitGtkMainLoop( _guiwindow_obj_ ); \
			return nret; \
		} \
	} \

#define ADD_CONTROL_LISTBOXROW_CALLBACK_IN_CREATE(_guiwindow_obj_,_guictl_obj_,_event_name_,_funcp_) \
	{ \
		int						nret = 0 ; \
		\
		nret = AddControlListboxRowEventCallback( rt , _guiwindow_obj_ , _guictl_obj_ , _event_name_ , _funcp_ ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			QuitGtkMainLoop( _guiwindow_obj_ ); \
			return nret; \
		} \
	} \

#define ADD_CONTROL_FLOWBOX_CHILD_ACTIVATED_CALLBACK_IN_CREATE(_guiwindow_obj_,_guictl_obj_,_event_name_,_funcp_) \
	{ \
		int				nret = 0 ; \
		\
		nret = AddControlFlowboxChildActivatedEventCallback( rt , _guiwindow_obj_ , _guictl_obj_ , _event_name_ , _funcp_ ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			QuitGtkMainLoop( _guiwindow_obj_ ); \
			return nret; \
		} \
	} \

#define ADD_MENU_ITEM_CALLBACK_IN_CREATE(_guiwindow_obj_,_guictl_obj_,_label_,_event_name_,_funcp_) \
	{ \
		int				nret = 0 ; \
		\
		nret = AddMenuItemEventCallback( rt , _guiwindow_obj_ , _guictl_obj_ , _label_ , _event_name_ , _funcp_ ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			QuitGtkMainLoop( _guiwindow_obj_ ); \
			return nret; \
		} \
	} \

#define TRANSFER_MASTER_OBJECT_TO_OUTPUT_OBJECT \
	{ \
		int	nret = 0 ; \
		\
		nret = TransferMasterObjectToOutputObject( rt , out1 , obj ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			return nret; \
		} \
	} \

struct ZlangDirectProperty_guiorientation
{
	int				dummy ;
} ;

#define GUIORIENTATION_HORIZONTAL	GTK_ORIENTATION_HORIZONTAL
#define GUIORIENTATION_VERTICAL		GTK_ORIENTATION_VERTICAL

struct ZlangDirectProperty_guialign
{
	int				dummy ;
} ;

struct ZlangDirectProperty_guijustify
{
	int				dummy ;
} ;

#define GUIALIGN_START		GTK_ALIGN_START
#define GUIALIGN_CENTER		GTK_ALIGN_CENTER
#define GUIALIGN_END		GTK_ALIGN_END
#define GUIALIGN_FILL		GTK_ALIGN_FILL

struct ZlangDirectProperty_guimouse
{
	int				dummy ;
} ;

struct ZlangDirectProperty_guikey
{
	int				dummy ;
} ;

struct ZlangDirectProperty_guilicense
{
	int				dummy ;
} ;

struct ZlangDirectProperty_guimonitor
{
	int				dummy ;
} ;

struct ZlangDirectProperty_guiclipboard
{
	int				dummy ;
} ;

#define ADD_TIMER_CALLBACK_IN_CREATE(_guiwindow_obj_,_interval_milliseconds_,_funcp_) \
	{ \
		int			nret = 0 ; \
		\
		nret = AddTimerEventCallback( rt , _guiwindow_obj_ , _interval_milliseconds_ , _funcp_ ) ; \
		if( nret ) \
		{ \
			UnreferObject( rt , out1 ); \
			QuitGtkMainLoop( _guiwindow_obj_ ); \
			return nret; \
		} \
	} \

#define EXCEPTION_MESSAGE_INTERNAL_ERROR				"internal error"
#define EXCEPTION_MESSAGE_PARAMETERS_INVALID				"parameters invalid"
#define EXCEPTION_MESSAGE_PARAMETERS_NOT_SUPPORTED			"parameters not supported"
#define EXCEPTION_MESSAGE_PARAMETERS_COUNT_NOT_MATCHED			"parameters count not matched"
#define EXCEPTION_MESSAGE_PARAMETER_TYPE_NOT_MATCHED			"parameter type not matched"
#define EXCEPTION_MESSAGE_CLONE_OBJECT_FAILED				"clone object failed"
#define EXCEPTION_MESSAGE_ALLOC_CONTROL_CALLBACK_EVENT_FAILED		"alloc control callback event failed"
#define EXCEPTION_MESSAGE_ALLOC_OBJECT_FAILED				"alloc object failed"
#define EXCEPTION_MESSAGE_GTK_MENU_BAR_NEW_FAILED			"grk_menu_bar_new failed"
#define EXCEPTION_MESSAGE_GTK_MENU_NEW_FAILED				"gtk_menu_new failed"
#define EXCEPTION_MESSAGE_GTK_MENU_ITEM_NEW_FAILED			"gtk_menu_item_new failed"
#define EXCEPTION_MESSAGE_GTK_MENU_APPEND_FAILED			"gtk_menu_append failed"
#define EXCEPTION_MESSAGE_GTK_MENU_ITEM_SET_SUBMENU_FAILED		"gtk_menu_item_set_submenu failed"
#define EXCEPTION_MESSAGE_GTK_TOOL_BAR_NEW_FAILED			"gtk_toolbar_new failed"
#define EXCEPTION_MESSAGE_CANT_CREATE_ON_CURRENT_WINDOW_TYPE		"can't create on current window type"
#define EXCEPTION_MESSAGE_WINDOW_TYPE_INVALID				"window type invalid"
#define EXCEPTION_MESSAGE_WINDOW_TYPE_INVALID				"window type invalid"
#define EXCEPTION_MESSAGE_LANGUAGE_NOT_FOUND				"language not found"
#define	EXCEPTION_MESSAGE_G_STRDUP_FAILED				"g_strdup failed"
#define EXCEPTION_MESSAGE_GET_PARENT_WIDGET_FAILED			"get parent widget failed"
#define EXCEPTION_MESSAGE_GET_CHILD_WIDGET_FAILED			"get child widget failed"
#define EXCEPTION_MESSAGE_SET_LAYOUT_INVALID				"set layout failed"
#define EXCEPTION_MESSAGE_NEW_GTK_OBJECT_FAILED				"new gtk object failed"
#define EXCEPTION_MESSAGE_GTK_WIDGET_TYPE_NOT_MATCHED			"gtk widget type not matched"
#define EXCEPTION_MESSAGE_QUERY_PARENT_WIDGET_NOT_FOUND			"query parent widget not found"
#define EXCEPTION_MESSAGE_QUERY_CHILD_WIDGET_NOT_FOUND			"query child widget not found"

#define DEFINE_GUICOLUMN_OBJECT(_obj_name_) \
	ZlangInvokeFunction ZlangInvokeFunction_gui##_obj_name_##_CreateWithColumnName; \
	int ZlangInvokeFunction_gui##_obj_name_##_CreateWithColumnName( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangObject				*in1 = GetInputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangObject				*out1 = GetOutputParameterInLocalObjectStack(rt,1) ; \
		struct ZlangDirectProperty_gui##_obj_name_	*gui##_obj_name_##_direct_prop = GetObjectDirectProperty(out1) ; \
		struct ZlangDirectProperty_guiwidget_common	*gui##_obj_name_##_common = & (gui##_obj_name_##_direct_prop->common) ; \
		char						*column_name = NULL ; \
		\
		CallRuntimeFunction_string_GetStringValue( rt , in1 , & column_name , NULL ); \
		\
		CallRuntimeFunction_string_SetStringValue( rt , gui##_obj_name_##_common->zobjects_data.str_obj , column_name , STRLEN_OF_STRING ); \
		\
		return 0; \
	} \
	\
	ZlangCreateDirectPropertyFunction ZlangCreateDirectProperty_gui##_obj_name_; \
	void *ZlangCreateDirectProperty_gui##_obj_name_( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_obj_name_	*gui##_obj_name_##_direct_prop = NULL ; \
		int						nret = 0 ; \
		\
		gui##_obj_name_##_direct_prop = (struct ZlangDirectProperty_gui##_obj_name_ *)ZLMALLOC( sizeof(struct ZlangDirectProperty_gui##_obj_name_) ) ; \
		if( gui##_obj_name_##_direct_prop == NULL ) \
		{ \
			SET_RUNTIME_ERROR( rt , RUNTIME_ERROR , ZLANG_ERROR_ALLOC , "alloc memory for entity" ) \
			return NULL; \
		} \
		memset( gui##_obj_name_##_direct_prop , 0x00 , sizeof(struct ZlangDirectProperty_gui##_obj_name_) ); \
		\
		nret = CloneObject( rt , & (gui##_obj_name_##_direct_prop->common.zobjects_data.str_obj) , NULL , GetStringObjectInRuntimeObjectsHeap(rt) ) ; \
		if( nret ) \
		{ \
			return NULL; \
		} \
		\
		return (struct ZlangEntity *)gui##_obj_name_##_direct_prop; \
	} \
	\
	ZlangDestroyDirectPropertyFunction ZlangDestroyDirectProperty_gui##_obj_name_; \
	void ZlangDestroyDirectProperty_gui##_obj_name_( struct ZlangRuntime *rt , struct ZlangObject *obj ) \
	{ \
		struct ZlangDirectProperty_gui##_obj_name_	*gui##_obj_name_##_direct_prop = GetObjectDirectProperty(obj) ; \
		\
		if( gui##_obj_name_##_direct_prop->common.zobjects_data.str_obj ) \
		{ \
			DestroyObject( rt , gui##_obj_name_##_direct_prop->common.zobjects_data.str_obj ); \
		} \
		\
		ZLFREE( gui##_obj_name_##_direct_prop ); \
		\
		return; \
	} \
	\
	static struct ZlangDirectFunctions direct_funcs_gui##_obj_name_ = \
		{ \
			ZLANG_OBJECT_gui##_obj_name_ , \
			\
			ZlangCreateDirectProperty_gui##_obj_name_ , \
			ZlangDestroyDirectProperty_gui##_obj_name_ , \
			\
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			\
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			\
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			\
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			\
			NULL , \
			NULL , \
			\
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			NULL , \
			\
			NULL , \
		} ; \
	\
	ZlangImportObjectFunction ZlangImportObject_gui##_obj_name_; \
	struct ZlangObject *ZlangImportObject_gui##_obj_name_( struct ZlangRuntime *rt ) \
	{ \
		struct ZlangObject	*obj = NULL ; \
		struct ZlangFunction	*func = NULL ; \
		int			nret = 0 ; \
		\
		nret = ImportObject( rt , & obj , ZLANG_OBJECT_gui##_obj_name_ , & direct_funcs_gui##_obj_name_ , sizeof(struct ZlangDirectFunctions) , NULL ) ; \
		if( nret ) \
		{ \
			SET_RUNTIME_ERROR( rt , RUNTIME_ERROR , ZLANG_ERROR_LINK_FUNC_TO_ENTITY , "import object to global objects heap" ) \
			DestroyObject( rt , obj ); \
			return NULL; \
		} \
		\
		func = AddFunctionAndParametersInObject( rt , obj , ZlangInvokeFunction_gui##_obj_name_##_CreateWithColumnName , ZLANG_OBJECT_gui##_obj_name_ , "CreateWithColumnName" , ZLANG_OBJECT_string,NULL , NULL ) ; \
		if( func == NULL ) \
			return NULL; \
		\
		return obj ; \
	} \

DLLEXPORT ZlangImportObjectsFunction ZlangImportObjects;
int ZlangImportObjects( struct ZlangRuntime *rt );

#endif

